#!/bin/bash

export RTL_ROOT="$(pwd)/../../../rtl"
export V2COM_ROOT="${RTL_ROOT}/v2_common"
export V2M_ROOT="${RTL_ROOT}/v2_master"
export V2S_ROOT="${RTL_ROOT}/v2_slave"
export AYAR_RTL="${V2COM_ROOT}/armod"
export BC_RTL="${V2COM_ROOT}/dig/bc_mod"
export BC_ANA="${V2COM_ROOT}/ana"

SEED=1

vcs +lint=TFIPC-L -sverilog +v2k -full64 +vcs+vcdpluson -timescale=1ps/1ps +define+VCS+BEHAVIORAL+TIMESCALE_EN -f ../../flist/aib_defines.cf -f ../../flist/aibcr3_buffx1_top.cf -f ../../flist/aib_analog.cf -f ../../flist/aibcr3_cmn.cf -f ../../flist/aibcr3_top_wrp.cf -f ../../flist/c3aibadapt_wrap.cf -f ../../flist/ms_v2.cf ./c3aib_master.sv ./top.sv ./dut_io.sv ./test.sv

if [ "$1" != "" ]; then
    echo "Running simulation"
    ./simv -l sim.log +ntb_random_seed=$SEED
fi